//system API wrapper
// $Id: sys_alloc.h 511 2010-07-15 11:06:32Z Oleg.Bulychov $
#pragma once
//__________________________________________________________________________________
#include "src/heo/include/mem_util.h"
//__________________________________________________________________________________
namespace mem_util
{
//__________________________________________________________________________________
class sys_page_allocator
{
    DISALLOW_COPY_AND_ASSIGN(sys_page_allocator);
public:
    typedef char TPage[MEM_PAGE_SIZE];
protected:
    void* p_;
    TPage* first_page_;
    size_t num_pages_;
public:
//.............................................................................
    explicit sys_page_allocator() NO_THROW_(): p_(), first_page_(), num_pages_()
    {}
//.............................................................................
    ~sys_page_allocator() NO_THROW_();
//.............................................................................
    int Alloc(size_t nPages) NO_THROW_();
//.............................................................................
    TPage* get_Buffer() const NO_THROW_()
    {
        return first_page_;
    }
//.............................................................................
    size_t get_Num_Pages() const NO_THROW_()
    {
        return num_pages_;
    }
};
//__________________________________________________________________________________
//__________________________________________________________________________________
//__________________________________________________________________________________
//__________________________________________________________________________________
}//:mem_util

//EOF!
